package com.kpmg.datalake.autopackage.service.impl;

import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONObject;
import com.kpmg.datalake.autopackage.service.CustomTemplateService;
import com.kpmg.datalake.autopackage.utils.ExcelOperateUtil;
import com.kpmg.datalake.autopackage.vo.ResultData;

/**   
 * @ClassName:   CustomTemplateServiceImpl   
 * @Description: 自定义配置模板管理模块
 * @author:      changpengye 
 * @Company      KPMG   
 * @date:        2018年7月6日 下午2:46:10   
 * @version      V1.0  
 * @modifier     
 * @reason       
 */  

@Service
public class CustomTemplateServiceImpl implements CustomTemplateService {
	/**
	 * <p>Title:       getFullTemplateInfor</p>   
	 * <p>Description: 获取全量模板信息</p>   
	 * @param path
	 * @return   
	 * @see com.kpmg.datalake.autopackage.service.CustomTemplateService#getFullTemplateInfor(java.lang.String)   
	 */  
	@Override
	public JSONObject getFullTemplateInfor(String path) {
		Workbook template = ExcelOperateUtil.getWorkbook(path);
		String[] sheets = ExcelOperateUtil.getSheets(template);
		return ResultData.getSuccess("查询成功", sheets);
	}


	/**   
	 * <p>Title:       createCustomTemplate</p>   
	 * <p>Description: 生成目标模板并入库保存</p>   
	 * @param check
	 * @param uCheck
	 * @param sourceId
	 * @param sourcePath
	 * @param projectId
	 * @param fileNm
	 * @param remark
	 * @param userId
	 * @return   
	 * @see com.kpmg.datalake.autopackage.service.CustomTemplateService#createCustomTemplate(java.lang.String[], java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)   
	 */  
	@Override
	public JSONObject createCustomTemplate() {

		return null;
	}


	@Override
	public JSONObject updateCustomTemplate(String templateId) {
		return null;
	}
	
	
}
